package hotciv.variants;

import java.util.Collection;

import hotciv.common.*;
import hotciv.framework.*;
import hotciv.strategies.WinnerStrategy;

public class BetaCivWinnerStrategy implements WinnerStrategy {

	@Override
	public Player getWinner(ModifiableGame game) {
		Collection<CityImpl> cityCollection = game.getCities();
		int redCities = 0,blueCities = 0;
		
		for(CityImpl city : cityCollection) {
			if(city.getOwner() == Player.BLUE) blueCities++;
			if(city.getOwner() == Player.RED) redCities++;
		}
		
		if(blueCities==0) return Player.RED;
		if(redCities==0) return Player.BLUE;
		return null;
	}

}
